package com.cn.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.cn.dao.newList.TbNewsDao;
import com.cn.entity.TbNews;
import com.cn.service.newList.TbNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author zxl
 * @Date 2021/6/3 14:38
 * @Package com.service.impl
 * @Version 1.0
 */
@Service
public class TbNewsServiceImpl implements TbNewsService {
    @Autowired
    private TbNewsDao tbNewsDao;


    @Override
    public IPage<TbNews> selectAllTbNews(int pageNum) {
        int pageSize = 3;
        Page<TbNews> page = new Page<>(pageNum, pageSize);
        QueryWrapper<TbNews> wrapper = new QueryWrapper<>();
        wrapper.eq("name","李四");
        Page<TbNews> tbNewsPage = tbNewsDao.selectPage(page, null);
        return tbNewsPage;
    }

    @Override
    public int updateTbNewsById(TbNews tbNews) {
        return 0;
    }

    @Override
    public int addTbNews(TbNews tbNews) {
        return 0;
    }

    @Override
    public int deleteTbNewsById(long id) {
        return 0;
    }

    @Override
    public Page<TbNews> selectTbNewsByNewsTitle() {
        return null;
    }
}
